<html>
<head><meta charset="utf-8"><title>const in array repeat expressions · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html">const in array repeat expressions</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="171248792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171248792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171248792">(Jul 19 2019 at 11:17)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span>  <span class="user-mention" data-user-id="116107">@davidtwco</span> <span class="user-mention" data-user-id="116118">@Matthew Jasper</span> any idea why "const array repeat expressions" don't work in liballoc even with the feature set? See <a href="https://github.com/rust-lang/rust/commit/4c2c7e0cc9b2b589fe2bab44173acc2170b20c09" target="_blank" title="https://github.com/rust-lang/rust/commit/4c2c7e0cc9b2b589fe2bab44173acc2170b20c09">https://github.com/rust-lang/rust/commit/4c2c7e0cc9b2b589fe2bab44173acc2170b20c09</a> for the code, and <a href="https://github.com/rust-lang/rust/issues/53491#issuecomment-513147996" target="_blank" title="https://github.com/rust-lang/rust/issues/53491#issuecomment-513147996">https://github.com/rust-lang/rust/issues/53491#issuecomment-513147996</a> for the error. Inlining the macro makes no difference so that's not it.</p>



<a name="171249021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171249021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171249021">(Jul 19 2019 at 11:21)</a>:</h4>
<p>maybe the problem is that he <code>const fn</code> being called is not in the same crate?</p>



<a name="171249030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171249030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171249030">(Jul 19 2019 at 11:21)</a>:</h4>
<p>I seem to recall that being an issue for some stuff <span class="user-mention" data-user-id="124288">@oli</span> did in the past. Seems like a bad footgun.</p>



<a name="171250836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171250836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171250836">(Jul 19 2019 at 11:56)</a>:</h4>
<p>Did you enable the appropriate feature gate for the method to be const fn</p>



<a name="171251538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171251538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171251538">(Jul 19 2019 at 12:08)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> are you trying to use it at stage0?</p>



<a name="171251560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171251560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171251560">(Jul 19 2019 at 12:09)</a>:</h4>
<p>hmm, looks like no</p>



<a name="171251572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171251572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171251572">(Jul 19 2019 at 12:09)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> <span class="user-mention" data-user-id="124288">@oli</span> ohhh you need to manually allow promotion on <code>MaybeUninit::uninit</code></p>



<a name="171251578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171251578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171251578">(Jul 19 2019 at 12:09)</a>:</h4>
<p>ugh this is annoying</p>



<a name="171251663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171251663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171251663">(Jul 19 2019 at 12:10)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> <span class="user-mention" data-user-id="120791">@RalfJ</span> can we special-case zero-arg const fn's as always promotable? they're effectively constants that you call like a function for no real reason other than aesthetics :P</p>



<a name="171251677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171251677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171251677">(Jul 19 2019 at 12:11)</a>:</h4>
<p>we should even intern their computation like constants</p>



<a name="171251695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171251695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171251695">(Jul 19 2019 at 12:11)</a>:</h4>
<p>not unlike the zero-arg intrinsics that are supported by CTFE, now that I think about it</p>



<a name="171252637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171252637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171252637">(Jul 19 2019 at 12:26)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> <span class="user-mention silent" data-user-id="124288">oli</span> ohhh you need to manually allow promotion on <code>MaybeUninit::uninit</code></p>
</blockquote>
<p>promotion is involved, then? also why does it work in libcore?</p>



<a name="171252656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171252656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171252656">(Jul 19 2019 at 12:27)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <span class="user-mention silent" data-user-id="120791">RalfJ</span> can we special-case zero-arg const fn's as always promotable? they're effectively constants that you call like a function for no real reason other than aesthetics :P</p>
</blockquote>
<p>please no let's not make more things promotable^^</p>



<a name="171252680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171252680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171252680">(Jul 19 2019 at 12:27)</a>:</h4>
<p>ugh</p>



<a name="171252792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171252792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171252792">(Jul 19 2019 at 12:29)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> is right though in the sense that adding <code>#[rustc_promotable]</code> to <code>MaybeUninit::uninit</code> fixes it</p>



<a name="171252800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171252800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171252800">(Jul 19 2019 at 12:29)</a>:</h4>
<p>but why is that not needed within the same crate?</p>



<a name="171252812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171252812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171252812">(Jul 19 2019 at 12:29)</a>:</h4>
<p>alternatively, we could move the <code>Copy</code> analysis involved here into the borrowck but id khow much I like that</p>



<a name="171252819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171252819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171252819">(Jul 19 2019 at 12:29)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> that it works same-crate without promotable is <em>weird</em></p>



<a name="171252838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171252838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171252838">(Jul 19 2019 at 12:29)</a>:</h4>
<p>maybe report as a bug, especially if you can repro in a small standalone crate</p>



<a name="171252926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171252926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171252926">(Jul 19 2019 at 12:31)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> so, some back story: this idea that <code>[expr; n]</code> could use promotion on <code>expr</code> to bypass the <code>Copy</code> requirement... predates the discovery of how annoying promoting const fn's is</p>



<a name="171253029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171253029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171253029">(Jul 19 2019 at 12:32)</a>:</h4>
<p>funny that I wrote a comment about promotion and array-repeat earlier today without having any idea^^</p>



<a name="171253047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171253047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171253047">(Jul 19 2019 at 12:32)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/49147#issuecomment-513148454" target="_blank" title="https://github.com/rust-lang/rust/issues/49147#issuecomment-513148454">https://github.com/rust-lang/rust/issues/49147#issuecomment-513148454</a></p>



<a name="171253072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171253072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171253072">(Jul 19 2019 at 12:33)</a>:</h4>
<p>and no I cannot repro... seems to be a libcore magic thing</p>



<a name="171253410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171253410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171253410">(Jul 19 2019 at 12:38)</a>:</h4>
<p>oh</p>



<a name="171253420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171253420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171253420">(Jul 19 2019 at 12:39)</a>:</h4>
<p>I think the uses in libcore just <em>are</em> <code>Copy</code>, actually^^</p>



<a name="171253635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171253635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171253635">(Jul 19 2019 at 12:42)</a>:</h4>
<p>yeah. since introducing the macro we got <code>MaybeUninit&lt;T&gt;: Copy</code> if <code>T: Copy</code>, so it's not as needed any more as it was. but in liballoc it still truly is needed.</p>



<a name="171254158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171254158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171254158">(Jul 19 2019 at 12:50)</a>:</h4>
<p>see <a href="https://github.com/rust-lang/rust/pull/62799" target="_blank" title="https://github.com/rust-lang/rust/pull/62799">https://github.com/rust-lang/rust/pull/62799</a></p>



<a name="171313919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171313919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171313919">(Jul 20 2019 at 06:08)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> let's rather add AnonConst as something users can write via <code>const{}</code> blocks or sth</p>



<a name="171313932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171313932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171313932">(Jul 20 2019 at 06:09)</a>:</h4>
<p>We can even create diagnostics suggesting such blocks in case some code errors due to not getting promoted when it could have been const</p>



<a name="171327622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171327622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171327622">(Jul 20 2019 at 13:31)</a>:</h4>
<p>ugh</p>



<a name="171327664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171327664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171327664">(Jul 20 2019 at 13:32)</a>:</h4>
<p>I mean, feel free to RFC it</p>



<a name="171327668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171327668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171327668">(Jul 20 2019 at 13:32)</a>:</h4>
<p>but it will be a minor nightmare</p>



<a name="171327679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171327679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171327679">(Jul 20 2019 at 13:33)</a>:</h4>
<p>unlike consts of array lengths or const generic path args, for example, you'll need shared inference with the parent</p>



<a name="171328956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171328956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171328956">(Jul 20 2019 at 14:11)</a>:</h4>
<p>Hm</p>



<a name="171341994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20in%20array%20repeat%20expressions/near/171341994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20in.20array.20repeat.20expressions.html#171341994">(Jul 20 2019 at 20:47)</a>:</h4>
<p>a replacement for (complex) promotion would also need to share inference with the parent though I guess?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>